class Student:
    def __init__(self, name):
        self.name = name
        self.grades = []

    def add_grade(self, grade):
        if isinstance(grade, (int, float)):
            self.grades.append(grade)
        else:
            print("请输入有效的数字成绩。")

    def get_average_grade(self):
        if not self.grades:
            return 0
        return sum(self.grades) / len(self.grades)
    
    def __str__(self): 
        return f"学生姓名: {self.name}, 分数：{self.grades},平均分: {self.get_average_grade():.2f}"

student1 = Student("李华")
student1.add_grade(92)
student1.add_grade(88)
student1.add_grade(95)
print(student1)

student2 = Student("小明")
student2.add_grade(78)
student2.add_grade(82)
print(student2)